home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Win '95 Giga Pack
/
Win95 Giga Pack (Maple Media) (1997).iso
/
UTILITY
/
WNBT32
/
FILESIZE.WB_
< prev
next >
Wrap
Text File
|
1996-01-05
|
2KB
|
67 lines
;DIRSIZE
;This file traverses the directory tree and computes the total
;size of all files on the drive.
;
IntControl(29,@tab,0,0,0) ; Standardize on tabs for file/dir delimiters
DirChange("C:\")
BoxOpen("File Size Inspector","Reading Initial Directories")
tot = FileSize(FileItemize("*.*"))
sub1 = DirItemize("*.*")
totdir=0
level=1
dir1=DirGet()
numdir1 = ItemCount(sub1, @tab)
index1 = 0
:dsloop
If index%level% == numdir%level% Then Goto upalevel
index%level% = index%level% + 1
DirChange(StrCat(dir%level%, ItemExtract(index%level%, sub%level%, @tab)))
BoxText(strcat("Level=",level,@crlf,"Total=",tot,@crlf,dir%level%))
totdir=totdir+1
tot = tot + FileSize(FileItemize("*.*"))
level = level + 1
dir%level% = DirGet()
sub%level% = DirItemize("*.*")
numdir%level% = ItemCount(sub%level%, @tab)
index%level% = 0
goto dsloop
:upalevel
drop(dir%level%,sub%level%,index%level%,numdir%level%)
level=level-1
if level!=0 then goto dsloop
; -----------
; Termination
; -----------
BoxShut()
If StrLen(tot) < 9 Then tot = StrCat(StrFill("", 9 - StrLen(tot)), tot)
tot = StrCat(StrSub(tot,1,3),",",StrSub(tot,4,3),",",StrSub(tot,7,3))
tot = StrTrim(tot)
If StrSub(tot, 1, 1) == "," Then tot = StrSub(tot, 2, StrLen(tot) - 1)
tot = StrTrim(tot)
If StrSub(tot, 1, 1) == "," Then tot = StrSub(tot, 2, StrLen(tot) - 1)
tot = StrTrim(tot)
Message("%totdir% Subdirectories included", "Total size %tot% bytes.")
Exit